{% extends "admin/base_site.html" %}
{% load i18n %}

{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}/admin/css/dashboard.css" />{% endblock %}

{% block coltype %}colMS{% endblock %}

{% block bodyclass %}dashboard{% endblock %}

{% block breadcrumbs %}{% endblock %}

{% block content %}
<div id="content-main">

{% if app_list %}
    {% for app in app_list %}
        <table class="table table-bordered table-striped" summary="{% blocktrans with app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}">
            <tr>
                <th colspan="2" class="title"><a href="{{ app.app_url }}" class="section">{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</a></th>
            </tr>
        {% for model in app.models %}
            <tr>
            {% if model.perms.change %}
                <th scope="row"><a href="{{ model.admin_url }}">{{ model.name }}</a></th>
            {% else %}
                <th scope="row">{{ model.name }}</th>
            {% endif %}
                <td width="20%">
                 <div data-toggle="buttons-checkbox" class="btn-group">
                     {% if model.perms.add %}
                     <a href="{{ model.admin_url }}add/" class="btn">{% trans 'Add' %}</a>
                     {% endif %}
                     {% if model.perms.change %}
                     <a href="{{ model.admin_url }}" class="btn">{% trans 'Change' %}</a>
                     {% endif %}
                 </div>
                </td>
            </tr>
        {% endfor %}
        </table>
    {% endfor %}
{% else %}
    <p>{% trans "You don't have permission to edit anything." %}</p>
{% endif %}
</div>
{% endblock %}

{% block sidebar %}
<div class="well">
    <ul class="nav nav-list">
        <li class="nav-header">{% trans 'Recent Actions' %}</li>
        <li class="divider"></li>
        <li class="nav-header">{% trans 'My Actions' %}</li>
        <li>
          {% load log %}
        </li>
        {% get_admin_log 10 as admin_log for_user user %}
        {% if not admin_log %}
        <li>
             <p class="tip">{% trans 'None available' %}</p>
        </li>
        {% for entry in admin_log %}
        <li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
            {% if entry.is_deletion or not entry.get_admin_url %}
                {{ entry.object_repr }}
            {% else %}
                <a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>
            {% endif %}
            <br/>
            {% if entry.content_type %}
                <span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span>
            {% else %}
                <span class="mini quiet">{% trans 'Unknown content' %}</span>
            {% endif %}
        </li>
        {% endfor %}
        {% endif %}
    </ul>
</div>
{% endblock %}
